using UnityEngine;

public class LoadingPanel : MonoBehaviour
{
	public GameObject blockPanel;

	public GameObject loadAnimation;

	public static LoadingPanel instance;

	private void Awake()
	{
		instance = this;
		ShowLoadingPanel(false);
	}

	public void ShowLoadingPanel(bool val)
	{
		blockPanel.SetActive(val);
		loadAnimation.SetActive(val);
		if (val)
		{
			Invoke("Hide", 10f);
		}
		else
		{
			CancelInvoke("Hide");
		}
	}

	private void Hide()
	{
		ShowLoadingPanel(false);
	}
}
